<!--
#  Copyright 2007, Javid Jamae and Peter Johnson
#
#  Licensed under the Apache License, Version 2.0 (the "License"); you may not
#  use this file except in compliance with the License. You may obtain a copy
#  of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#  License for the specific language governing permissions and limitations
#  under the License.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

<head>
<link rel="STYLESHEET" href="../ch00/image/jbia.css" type="text/css" />
<title>JBIA - JBoss Messaging</title>
</head>

<body>

<h1>Ch 4 - Securing Applications</h1>
<p>All build targets create an application server configuration
named <code> security</code>. After the build, to run the application
server, open another command window, <code>cd</code> to the applications
server's <code>bin</code> directory, and enter:</p>
<table class="command">
	<tr>
		<td class="commandText">./run.sh -c security</td>
		<td>(Linux)</td>
	</tr>
	<tr>
		<td class="commandText">run -c security</td>
		<td>(Windows)</td>
	</tr>
</table>
<p>None of the targets creates a database.</p>
<hr />
<table class="target">
	<tr>
		<th>Target:</th>
		<td class="targetNumber">01</td>
	</tr>
	<tr>
		<th>Section:</th>
		<td>4.1.5, 4.3.1</td>
	</tr>
	<tr>
		<th>Description:</th>
		<td>Builds and deploys a Web application that uses the
		UsersRolesLoginModule to load security data from flat files. The
		security data is enabled using dynamic login configuration. The
		application uses FORM authentication, as discussed in chapter 6.</td>
	</tr>
	<tr>
		<th colspan="2">After the build:</th>
	</tr>
</table>
<p>Navigate to <a target="_blank"
	href="http://localhost:8080/jbiasecurity/sayhello">http://localhost:8080/jbiasecurity/sayhello</a>
to see a never before seen greeting application in action. When asked
for a user name and password, enter user name "somebody" with password
"special".</p>
<hr />
<table class="target">
	<tr>
		<th>Target:</th>
		<td class="targetNumber">02</td>
	</tr>
	<tr>
		<th>Section:</th>
		<td>4.1.5, 4.3.2</td>
	</tr>
	<tr>
		<th>Description:</th>
		<td>Builds and deploys a Web application that uses the
		DatabaseLoginModule. The security data is enabled using dynamic login
		configuration. The application uses FORM authentication, as discussed
		in chapter 6.</td>
	</tr>
	<tr>
		<th colspan="2">After the build:</th>
	</tr>
</table>
<p>If you have configured the the Hypersonic SQL database in the
ch00/build.properties file, navigate to <a target="_blank"
	href="http://localhost:8080/jbiasecurity/loaddata">http://localhost:8080/jbiasecurity/loaddata</a>
to load the user data into the in-memory database. If you are using
MYSQL or POSTGRES, the data should have been loaded during the build.</p>
<p>Navigate to <a target="_blank"
	href="http://localhost:8080/jbiasecurity/sayhello">http://localhost:8080/jbiasecurity/sayhello</a>
to see a never before seen greeting application in action. When asked
for a user name and password, enter user name "somebody" with password
"special".</p>
<hr />
<table class="target">
	<tr>
		<th>Target:</th>
		<td class="targetNumber">03</td>
	</tr>
	<tr>
		<th>Section:</th>
		<td>4.1.5, 4.3.4</td>
	</tr>
	<tr>
		<th>Description:</th>
		<td>Builds and deploys a Web application that uses the
		IdentityLoginModule. The security data is enabled using dynamic login
		configuration. The application uses FORM authentication, as discussed
		in chapter 6.</td>
	</tr>
	<tr>
		<th colspan="2">After the build:</th>
	</tr>
</table>
<p>Navigate to <a target="_blank"
	href="http://localhost:8080/jbiasecurity/sayhello">http://localhost:8080/jbiasecurity/sayhello</a>
to see a never before seen greeting application in action. When asked
for a user name and password, enter whatever you want. The IdentityLoginModule will always allow you to 
log in with the credentials supplied in the login module configuration.</p>
<hr />
<table class="target">
	<tr>
		<th>Target:</th>
		<td class="targetNumber">04</td>
	</tr>
	<tr>
		<th>Section:</th>
		<td>4.3.5</td>
	</tr>
	<tr>
		<th>Description:</th>
		<td>Builds and deploys a Web application that uses multiple
		UsersRolesIdentityModules, each pointing to different users and roles
		files. Both modules have their <code>flag</code> attribute set to <code>required</code>.
		Look at the <code>src/alt/04/resources/dynamic-login-config.xml</code>
		file to see how the modules are stacked. Also look in the <code>src/alt/04/resources</code>
		directory to see the users and roles files. Note that the user files
		are the same, but the role files are different. Because both login
		modules are set to optional, both are called and the roles from both
		are applied.</td>
	</tr>
	<tr>
		<th colspan="2">After the build:</th>
	</tr>
</table>
<p>Navigate to <a target="_blank"
	href="http://localhost:8080/jbiasecurity/sayhello">http://localhost:8080/jbiasecurity/sayhello</a>.
When asked for a user name and password, enter user name "somebody" with
password "special"</p>
<hr />
<table class="target">
	<tr>
		<th>Target:</th>
		<td class="targetNumber">05</td>
	</tr>
	<tr>
		<th>Section:</th>
		<td>4.3.5</td>
	</tr>
	<tr>
		<th>Description:</th>
		<td>Builds and deploys a Web application that uses multiple
		UsersRolesIdentityModules and does password stacking. Each login
		module points to a different users and roles files. Both modules have
		their <code>flag</code> attribute set to <code>required</code>. Look
		at the <code>src/alt/05/resources/dynamic-login-config.xml</code>
		file to see how the modules are stacked. Also look in the <code>src/alt/05/resources</code>
		directory to see the users and roles files. Both the user files are
		and the role files are different.</td>
	</tr>
	<tr>
		<th colspan="2">After the build:</th>
	</tr>
</table>
<p>Navigate to <a target="_blank"
	href="http://localhost:8080/jbiasecurity/sayhello">http://localhost:8080/jbiasecurity/sayhello</a>.
When asked for a user name and password, enter user name "somebody" with
password "special". If password-stacking were disabled, the login would
not work.</p>
<hr />
<p align="center">&copy; 2007, Javid Jamae and Peter Johnson</p>
</body>

</html>
